package com.rainwood.water_authority.ui.adapter;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.rainwood.water_authority.R;
import com.rainwood.water_authority.base.MyBaseAdapter;
import com.rainwood.water_authority.http.response.InventoryHomeBean;
import com.rainwood.water_authority.http.response.PanDianHistoryBean;

/**
 * @auther : hhx
 * @date :  2021/3/17
 * @des :
 */
public class HistoryPanDianAdapter extends MyBaseAdapter<PanDianHistoryBean.DataBean.RecordBean> {
    public HistoryPanDianAdapter(@NonNull Context context) {
        super(context);
    }

    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new ViewHolder();
    }

    private class ViewHolder extends MyBaseAdapter.ViewHolder {

        private final TextView tv_text;
        private final TextView tv_time;

        public ViewHolder() {
            super(R.layout.item_pandianhistory);
            tv_text = (TextView) findViewById(R.id.tv_text);
            tv_time = (TextView) findViewById(R.id.tv_time);

        }

        @Override
        public void onBindView(int position) {
            PanDianHistoryBean.DataBean.RecordBean recordBean = getItem(position);
            tv_text.setText(recordBean.getText());
            tv_time.setText(recordBean.getTime());
        }
    }
}
